home *** CD-ROM | disk | FTP | other *** search
Wrap
VERSION 5.00 Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "MSWINSCK.OCX" Object = "{24365B29-A3B5-11D1-B8B0-444553540000}#1.0#0"; "Xfxforms.ocx" Begin VB.Form FrmGateWay BackColor = &H00FF8080& BorderStyle = 0 'None ClientHeight = 6195 ClientLeft = 4320 ClientTop = 3330 ClientWidth = 9285 LinkTopic = "Form1" ScaleHeight = 6195 ScaleWidth = 9285 ShowInTaskbar = 0 'False Begin VB.Timer tmrStarted Interval = 65000 Left = 4080 Top = 2880 End Begin xfxFormShaper.FormShaper FormShaper1 Left = 120 Top = 1080 _ExtentX = 1852 _ExtentY = 1296 End Begin VB.TextBox txtPingThis Height = 285 Left = 5880 TabIndex = 24 Top = 5280 Width = 1575 End Begin VB.Timer tmrScroll Interval = 50 Left = 5160 Top = 240 End Begin VB.Timer tmrUpdater Interval = 1000 Left = 3120 Top = 360 End Begin VB.Timer tmrAlert2 Enabled = 0 'False Index = 1 Interval = 1000 Left = 480 Top = 0 End Begin VB.Timer tmrAlert2 Enabled = 0 'False Index = 0 Interval = 10000 Left = 0 Top = 0 End Begin VB.Timer tmrAlert2 Enabled = 0 'False Index = 2 Interval = 1000 Left = 960 Top = 0 End Begin VB.Timer tmrDealWithResponseCodes Enabled = 0 'False Interval = 10000 Left = 4560 Top = 120 End Begin MSWinsockLib.Winsock WGate Left = 720 Top = 240 _ExtentX = 741 _ExtentY = 741 _Version = 327681 Protocol = 1 End Begin VB.Timer TmrCheckGateWays Interval = 1000 Left = 360 Top = 240 End Begin VB.Label lblPingStatus BackColor = &H00000000& BeginProperty Font Name = "MS Sans Serif" Size = 9.75 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H0000FFFF& Height = 615 Left = 4320 TabIndex = 33 Top = 3120 Width = 4815 End Begin VB.Label Label12 BackColor = &H00000000& Caption = " Bytes Sent" ForeColor = &H0000FFFF& Height = 255 Left = 4320 TabIndex = 32 Top = 3720 Width = 1335 End Begin VB.Label lblBytesSent BackColor = &H00000000& ForeColor = &H0000FFFF& Height = 255 Left = 5640 TabIndex = 31 Top = 3720 Width = 1215 End Begin VB.Label Label7 BackColor = &H00000000& Caption = " Bytes Recieved" ForeColor = &H0000FFFF& Height = 255 Left = 4320 TabIndex = 30 Top = 3960 Width = 1335 End Begin VB.Label lblBytesRecieved BackColor = &H00000000& ForeColor = &H0000FFFF& Height = 255 Left = 5640 TabIndex = 29 Top = 3960 Width = 1215 End Begin VB.Label Label9 BackColor = &H00000000& Caption = " Time in m/s" ForeColor = &H0000FFFF& Height = 255 Left = 4320 TabIndex = 28 Top = 4200 Width = 1335 End Begin VB.Label lblTimeMS BackColor = &H00000000& ForeColor = &H0000FFFF& Height = 255 Left = 5640 TabIndex = 27 Top = 4200 Width = 1215 End Begin VB.Label lblPStats2 BackColor = &H00000000& BeginProperty Font Name = "MS Sans Serif" Size = 9.75 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H0000FFFF& Height = 375 Left = 4320 TabIndex = 26 Top = 4440 Width = 4815 End Begin VB.Label Label5 BackColor = &H00000000& Caption = "Label11" Height = 735 Left = 6840 TabIndex = 25 Top = 3720 Width = 2295 End Begin VB.Image Image1 Height = 480 Left = 4560 Picture = "FrmGateWay.frx":0000 ToolTipText = "Add New Server" Top = 5160 Width = 480 End Begin VB.Image Image2 Height = 480 Left = 5280 Picture = "FrmGateWay.frx":0442 ToolTipText = "Reset Alarms" Top = 5160 Width = 480 End Begin VB.Image Image3 Height = 480 Left = 7680 Picture = "FrmGateWay.frx":0884 ToolTipText = "Manual Ping" Top = 5160 Width = 480 End Begin VB.Image Image4 Height = 480 Left = 8400 Picture = "FrmGateWay.frx":0CC6 ToolTipText = "Hide" Top = 5160 Width = 480 End Begin VB.Label lblScroll BackStyle = 0 'Transparent Caption = "WebMon GateWay Service Monitor" BeginProperty Font Name = "Comic Sans MS" Size = 18 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 615 Left = -5760 TabIndex = 23 Top = 120 Width = 6015 End Begin VB.Line Line17 BorderColor = &H0000FF00& X1 = 240 X2 = 3840 Y1 = 5280 Y2 = 5280 End Begin VB.Label Label3 BackColor = &H00000000& Caption = "Label3" Height = 495 Left = 120 TabIndex = 22 Top = 5280 Width = 3855 End Begin VB.Line Line16 BorderColor = &H0000FF00& X1 = 3840 X2 = 3840 Y1 = 4800 Y2 = 5280 End Begin VB.Line Line15 BorderColor = &H0000FF00& X1 = 240 X2 = 3840 Y1 = 4800 Y2 = 4800 End Begin VB.Line Line14 BorderColor = &H00FF00FF& X1 = 240 X2 = 3840 Y1 = 4560 Y2 = 4560 End Begin VB.Label Label1 BackColor = &H00000000& Caption = "Label1" Height = 255 Left = 120 TabIndex = 21 Top = 4560 Width = 3855 End Begin VB.Shape Shape5 Height = 855 Left = 4200 Shape = 4 'Rounded Rectangle Top = 5040 Width = 5055 End Begin VB.Shape Shape4 Height = 1935 Left = 4200 Shape = 4 'Rounded Rectangle Top = 3000 Width = 5055 End Begin VB.Line Line13 BorderColor = &H0000FF00& X1 = 240 X2 = 240 Y1 = 4800 Y2 = 5280 End Begin VB.Line Line12 BorderColor = &H0000FF00& X1 = 1320 X2 = 1320 Y1 = 4800 Y2 = 5280 End Begin VB.Line Line11 BorderColor = &H00FF00FF& X1 = 1320 X2 = 1320 Y1 = 3600 Y2 = 4560 End Begin VB.Line Line10 BorderColor = &H00FF00FF& X1 = 240 X2 = 240 Y1 = 3600 Y2 = 4560 End Begin VB.Line Line9 BorderColor = &H00FF00FF& X1 = 3840 X2 = 3840 Y1 = 3600 Y2 = 4560 End Begin VB.Line Line8 BorderColor = &H0000FF00& X1 = 240 X2 = 3960 Y1 = 5280 Y2 = 5280 End Begin VB.Line Line7 BorderColor = &H0000FF00& X1 = 240 X2 = 3960 Y1 = 4800 Y2 = 4800 End Begin VB.Line Line6 BorderColor = &H0000FF00& X1 = 240 X2 = 3840 Y1 = 5040 Y2 = 5040 End Begin VB.Line Line5 BorderColor = &H00FF00FF& X1 = 240 X2 = 3960 Y1 = 4560 Y2 = 4560 End Begin VB.Line Line4 BorderColor = &H00FF00FF& X1 = 240 X2 = 3840 Y1 = 4320 Y2 = 4320 End Begin VB.Line Line3 BorderColor = &H00FF00FF& X1 = 240 X2 = 3840 Y1 = 4080 Y2 = 4080 End Begin VB.Line Line2 BorderColor = &H00FF00FF& X1 = 240 X2 = 3840 Y1 = 3840 Y2 = 3840 End Begin VB.Line Line1 BorderColor = &H00FF00FF& X1 = 240 X2 = 3840 Y1 = 3600 Y2 = 3600 End Begin VB.Label lblNextCheck BackColor = &H00000000& ForeColor = &H0000FFFF& Height = 255 Left = 1320 TabIndex = 20 Top = 5040 Width = 2655 End Begin VB.Label lblCurrentTime BackColor = &H00000000& ForeColor = &H0000FFFF& Height = 255 Left = 1320 TabIndex = 19 Top = 4800 Width = 2655 End Begin VB.Label Label11 BackColor = &H00000000& Caption = " Next Scan" ForeColor = &H0000FFFF& Height = 255 Left = 120 TabIndex = 18 Top = 5040 Width = 1215 End Begin VB.Label Label10 BackColor = &H00000000& Caption = " Current Time" ForeColor = &H0000FFFF& Height = 255 Left = 120 TabIndex = 17 Top = 4800 Width = 1215 End Begin VB.Label lblDownTime BackColor = &H00000000& ForeColor = &H0000FFFF& Height = 255 Left = 1320 TabIndex = 16 Top = 4320 Width = 2655 End Begin VB.Label Label8 BackColor = &H00000000& Caption = " Down Time" ForeColor = &H0000FFFF& Height = 255 Left = 120 TabIndex = 15 Top = 4320 Width = 1215 End Begin VB.Label lblLastFail BackColor = &H00000000& ForeColor = &H0000FFFF& Height = 255 Left = 1320 TabIndex = 14 Top = 4080 Width = 2655 End Begin VB.Label Label6 BackColor = &H00000000& Caption = " Last Failed" ForeColor = &H0000FFFF& Height = 255 Left = 120 TabIndex = 13 Top = 4080 Width = 1215 End Begin VB.Label lblChecked BackColor = &H00000000& ForeColor = &H0000FFFF& Height = 255 Left = 1320 TabIndex = 12 Top = 3840 Width = 2655 End Begin VB.Label Label4 BackColor = &H00000000& Caption = " Last Checked" ForeColor = &H0000FFFF& Height = 255 Left = 120 TabIndex = 11 Top = 3840 Width = 1215 End Begin VB.Label lblIP BackColor = &H00000000& ForeColor = &H0000FFFF& Height = 255 Left = 1320 TabIndex = 10 Top = 3600 Width = 2655 End Begin VB.Label Label2 BackColor = &H00000000& Caption = " IP Address" ForeColor = &H0000FFFF& Height = 255 Left = 120 TabIndex = 9 Top = 3600 Width = 1215 End Begin VB.Label lblMName Alignment = 2 'Center BackColor = &H00000000& BeginProperty Font Name = "Comic Sans MS" Size = 14.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H0000FFFF& Height = 495 Left = 120 TabIndex = 8 Top = 3120 Width = 3855 End Begin VB.Shape Shape3 Height = 2895 Left = 0 Shape = 4 'Rounded Rectangle Top = 3000 Width = 4095 End Begin VB.Label lblGateWay Alignment = 2 'Center BackColor = &H00000000& BeginProperty Font Name = "MS Sans Serif" Size = 13.5 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H0000FFFF& Height = 735 Index = 7 Left = 7080 TabIndex = 7 Top = 2040 Visible = 0 'False Width = 2055 End Begin VB.Label lblGateWay Alignment = 2 'Center BackColor = &H00000000& BeginProperty Font Name = "MS Sans Serif" Size = 13.5 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H0000FFFF& Height = 735 Index = 6 Left = 7080 TabIndex = 6 Top = 1200 Visible = 0 'False Width = 2055 End Begin VB.Label lblGateWay Alignment = 2 'Center BackColor = &H00000000& BeginProperty Font Name = "MS Sans Serif" Size = 13.5 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H0000FFFF& Height = 735 Index = 5 Left = 4680 TabIndex = 5 Top = 2040 Visible = 0 'False Width = 2175 End Begin VB.Label lblGateWay Alignment = 2 'Center BackColor = &H00000000& BeginProperty Font Name = "MS Sans Serif" Size = 13.5 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H0000FFFF& Height = 735 Index = 4 Left = 4680 TabIndex = 4 Top = 1200 Visible = 0 'False Width = 2175 End Begin VB.Label lblGateWay Alignment = 2 'Center BackColor = &H00000000& BeginProperty Font Name = "MS Sans Serif" Size = 13.5 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H0000FFFF& Height = 735 Index = 3 Left = 2400 TabIndex = 3 Top = 2040 Visible = 0 'False Width = 2055 End Begin VB.Label lblGateWay Alignment = 2 'Center BackColor = &H00000000& BeginProperty Font Name = "MS Sans Serif" Size = 13.5 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H0000FFFF& Height = 735 Index = 2 Left = 2400 TabIndex = 2 Top = 1200 Visible = 0 'False Width = 2055 End Begin VB.Label lblGateWay Alignment = 2 'Center BackColor = &H00000000& BeginProperty Font Name = "MS Sans Serif" Size = 13.5 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H0000FFFF& Height = 735 Index = 1 Left = 120 TabIndex = 1 Top = 2040 Visible = 0 'False Width = 2055 End Begin VB.Label lblGateWay Alignment = 2 'Center BackColor = &H00000000& BeginProperty Font Name = "MS Sans Serif" Size = 13.5 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H0000FFFF& Height = 735 Index = 0 Left = 120 TabIndex = 0 Top = 1200 Visible = 0 'False Width = 2055 End Begin VB.Shape Shape2 Height = 1815 Left = 0 Shape = 4 'Rounded Rectangle Top = 1080 Width = 9255 End Begin VB.Shape Shape1 Height = 855 Left = 0 Shape = 4 'Rounded Rectangle Top = 120 Width = 9255 End Attribute VB_Name = "FrmGateWay" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Dim mmflag As Boolean Dim sax As Integer Public blnAllowAlarm As Boolean Dim beepcount As Integer Dim Say As Integer Dim intResponseCount As Integer Dim SayCount As Integer Option Explicit Private Sub Form_Load() Dim intLoadServers As Integer Me.Top = LSetting("TOP") Me.Left = LSetting("LEFT") intNoOfGateServers = (CInt(Val(LSetting("NoOfGateWays")))) With FormShaper1 .ShapeIt End With modWeb.refresh 'Me.Left = frmgateway.Left 'Me.Top = frmgateway.Top End Sub Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Dim fml As Long Dim fmt As Long Dim a As Integer For a = 0 To 7 lblGateWay(a).BorderStyle = 0 Next a If mmflag = True Then fml = Me.Left: fmt = Me.Top If X > sax Then Me.Left = fml + (X - sax) If X < sax Then Me.Left = fml - (sax - X) If Y > Say Then Me.Top = fmt + (Y - Say) If Y < Say Then Me.Top = fmt - (Say - Y) End If Image1.BorderStyle = 0 Image2.BorderStyle = 0 Image3.BorderStyle = 0 Image4.BorderStyle = 0 End Sub Private Sub form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) If mmflag = False Then sax = X Say = Y mmflag = True End If Me.MousePointer = vbSizePointer End Sub Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) mmflag = False Me.MousePointer = vbDefault End Sub Private Sub lblGateWay_Click(Index As Integer) lblIP = LSetting("GateWayIP" & Index) lblMName = LSetting("gateWayName" & Index) lblChecked = LSetting("LgateSend" & Index) lblLastFail = LSetting("LGateFail" & Index) If LSetting("GateDownSince" & Index) <> "" Then lblDownTime = ConvertToHMS(DateDiff("s", LSetting("GateDownSince" & Index), Now)) 'convert seconds to minutes and seconds Else lblDownTime = "None" End If intGateClicked = Index End Sub Private Sub Image1_Click() blnEdit = False frmNewgateWay.Show End Sub Private Sub Image1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Image1.BorderStyle = 1 End Sub Private Sub Image2_Click() Dim X As Integer For X = frmMain.tmrAlert.LBound To frmMain.tmrAlert.UBound frmMain.tmrAlert(X).Enabled = False ' disable all timers in the alert control array Next X For X = tmrAlert2.LBound To tmrAlert2.UBound tmrAlert2(X).Enabled = False ' disable all timers in the alert control array Next X Set frmMain.cSysTray1.TrayIcon = frmMain.imgIcon(0).Picture 'set tray icon For X = lblGateWay.LBound To lblGateWay.UBound lblGateWay(X).BackColor = &O0& ' set all labels to black Next X For X = frmMain.lblServer.LBound To frmMain.lblServer.UBound frmMain.lblServer(X).BackColor = &O0& ' set all labels to black Next X End Sub Private Sub Image2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Image2.BorderStyle = 1 End Sub Private Sub Image3_Click() Dim ECHO As ICMP_ECHO_REPLY FrmGateWay.lblBytesSent = "" FrmGateWay.lblBytesRecieved = "" FrmGateWay.lblTimeMS = "" FrmGateWay.lblPingStatus.Caption = "" lblPStats2.Caption = "" If Val(txtPingThis) > 0 And InStr(1, txtPingThis, ".") > 1 Then 'ensure that ip address is valid syntax FrmGateWay.lblPingStatus.Caption = "Pinging " & txtPingThis & _ "with 9 bytes of Data................." Call Ping(txtPingThis, ECHO) FrmGateWay.lblBytesSent = "9" ' am sending 'Echo This' which is 9 bytes FrmGateWay.lblBytesRecieved = ECHO.DataSize ' the data recieved back this should be 9 if successful FrmGateWay.lblTimeMS = ECHO.RoundTripTime 'time taken in m/s FrmGateWay.lblPingStatus.Caption = GetStatusCode(ECHO.status) 'status code see modping for details Select Case Val(GetStatusCode(ECHO.status)) Case 0 SayThis "Pinged the server " & txtPingThis & ". The ping was successful" lblPStats2.Caption = "Successful ping to " & txtPingThis Case Else FrmGateWay.lblPStats2.Caption = "Unable to ping " & txtPingThis SayThis "Couldnt Ping the server " & txtPingThis & ". The ping was UnSuccessful" End Select Else MsgBox ("Can't ping that!") End If End Sub Private Sub Image3_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Image3.BorderStyle = 1 End Sub Private Sub Image4_Click() Me.Hide End Sub Private Sub Image4_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Image4.BorderStyle = 1 End Sub Private Sub lblGateWay_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single) Dim intLabs As Integer If Button = 2 Then intGateClicked = Index If blnRebooting(Index) = True Then frmPopups.mnuGateReBoot.Caption = "Abort Reboot" Else frmPopups.mnuGateReBoot.Caption = "Reboot Server" End If PopupMenu frmPopups.mnuGateMain For intLabs = lblGateWay.LBound To lblGateWay.UBound lblGateWay(intLabs).Visible = False Next intLabs modWeb.refresh 'refresh server list End If End Sub Private Sub lblGateWay_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single) lblGateWay(Index).BorderStyle = 1 End Sub Private Sub tmralert2_Timer(Index As Integer) If Index = 0 Then tmrAlert2(0).Enabled = False tmrAlert2(1).Enabled = True tmrAlert2(2).Enabled = True End If If Index = 1 Then DoEvents Beep beepcount = beepcount + 1 If beepcount = 5 Then beepcount = 0 tmrAlert2(1).Enabled = False tmrAlert2(0).Enabled = True End If End If If Index = 2 Then If frmMain.cSysTray1.TrayIcon = frmMain.imgIcon(0).Picture Then Set frmMain.cSysTray1.TrayIcon = frmMain.imgIcon(1).Picture Else Set frmMain.cSysTray1.TrayIcon = frmMain.imgIcon(0).Picture End If End If End Sub Private Sub TmrCheckGateWays_Timer() Dim intWinsock As Integer Dim ssql As String TmrCheckGateWays.Enabled = False TmrCheckGateWays.Interval = 60000 If Not intNoOfGateServers = 0 Then For intWinsock = 1 To intNoOfGateServers WGate.RemotePort = LSetting("GateWayPort" & intWinsock - 1) WGate.RemoteHost = LSetting("GateWayip" & intWinsock - 1) 'sets the box code to send ,this is sent back ssql = "010" & intWinsock & "SELECT SYSDATE FROM DUAL" WGate.SendData Encrypt(ssql & "|", 8479, 4597) GateOk(intWinsock - 1) = False SSetting "LGateSend" & intWinsock - 1, Now Next intWinsock End If TmrCheckGateWays.Enabled = True End Sub Private Sub tmrDealWithResponseCodes_Timer() Dim X As Integer Dim strErrMsg As String Dim strM As String Dim strS As String Dim blnAllOk As Boolean blnAllOk = True For X = 0 To intNoOfGateServers - 1 If GateOk(X) = False Then lblGateWay(X).BackColor = &HFF& tmrAlert2(0).Enabled = True LogIt "Service Failed Test " & LSetting("GateWayName" & X) SSetting "LGateFail" & X, Now If LSetting("GateDownSince" & X) = "" Then SSetting "gateDownSince" & X, Now End If strM = Left(ConvertToHMS(DateDiff("s", LSetting("gateDownSince" & X), Now)), InStr(1, ConvertToHMS(DateDiff("s", LSetting("gateDownSince" & X), Now)), ":") - 1) strS = Mid(ConvertToHMS(DateDiff("s", LSetting("gateDownSince" & X), Now)), InStr(1, ConvertToHMS(DateDiff("s", LSetting("gateDownSince" & X), Now)), ":") + 1) SayCount = SayCount + 1 strErrMsg = "Warning! Critical service failure for " & LSetting("GateWayName" & X) & " at " & LSetting("LGateFail" & X) & " Service has not responded for " & _ strM & " Minutes and " & strS & " Seconds" If SayCount = 70 Then SayThis strErrMsg SayCount = 0 End If Else SSetting "gateDownSince" & X, "" lblGateWay(X).BackColor = &H0& If blnAllowAlarm = False Then tmrAlert2(0).Enabled = False tmrAlert2(1).Enabled = False tmrAlert2(2).Enabled = False End If End If Next X tmrDealWithResponseCodes.Enabled = False End Sub Private Sub tmrScroll_Timer() With lblScroll DoEvents .Left = .Left + 15 If .Left > 9000 Then .Left = -5760 End If End With End Sub Private Sub tmrStarted_Timer() tmrStarted = False blnAllowAlarm = True End Sub Private Sub tmrUpdater_Timer() On Error GoTo e_trap Dim intTempNext As Integer If LSetting("GateDownSince" & intGateClicked) <> "" Then lblDownTime = ConvertToHMS(DateDiff("s", LSetting("GateDownSince" & intGateClicked), Now)) lblDownTime = "None" End If lblCurrentTime.Caption = Format(Now, "hh:mm:ss") DoEvents intTempNext = DateDiff("s", Now, DateAdd("s", (TmrCheckGateWays.Interval / 1000), LSetting("LGateSend" & intGateClicked))) If intTempNext > TmrCheckGateWays.Interval Or intTempNext < 0 Then lblNextCheck = "Unknown" Else lblNextCheck = intTempNext End If Exit Sub e_trap: lblNextCheck = "Unknown" End Sub Private Sub WGate_DataArrival(ByVal bytesTotal As Long) Dim strTempData As String Dim intMsgCode As Integer Dim intBoxNo As Integer WGate.GetData strTempData If Not CInt(Val(Left(strTempData, 2))) = 4 Then intBoxNo = CInt(Val(Mid(strTempData, 3, 2))) GateOk(intBoxNo - 1) = True Else tmrDealWithResponseCodes.Enabled = True End If intResponseCount = intResponseCount + 1 If intResponseCount = intNoOfGateServers * 3 Then tmrDealWithResponseCodes.Enabled = True intResponseCount = 0 End If End Sub